]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenShield: Only wake up screen when active
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 9 Aug 2022 10:55:16 +0000 (12:55 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 10 Aug 2022 16:31:42 +0000 (16:31 +0000)
We treat wake up requests the same as user activity, as in general
the two behave the same: Turn on the screen and reset the idle watch
until the system becomes idle again.

The big exception is when the screen isn't locked yet. In that case
user activity should interrupt the automatic screen lock, but a
request to wake-up the screen (like showing a notification) should
not.

Address this by ignoring wake-up requests while the screen shield
isn't active, as we can expect the screen to still be turned on at
that point.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5719

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2413>

js/ui/screenShield.js

index 39fb09a84362835dc0293b75b56c0997dff77f58..325fbff53282d275c9ee69f7f4c9ad78d2981696 100644 (file)
@@ -515,6 +515,8 @@ var ScreenShield = class extends Signals.EventEmitter {
     }
 
     _wakeUpScreen() {
+        if (!this.active)
+            return; // already woken up, or not yet asleep
         this._onUserBecameActive();
         this.emit('wake-up-screen');
     }